package org.sun.sunshine.io.cun;

import java.util.concurrent.Callable;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.FutureTask;

public class EchoCall implements Callable {
    @Override
    public Object call() throws Exception {
        System.out.println("echo" );
        throw new RuntimeException("就是个异常");

    }


    public static void main(String[] args) {
        FutureTask futureTask = new FutureTask(new EchoCall());
        //new Thread(futureTask).start();
        try {
            System.out.println("");
            new Thread(()-> {throw new RuntimeException("就是个异常");});
            //
            futureTask.get();
        } catch (Exception e) {
            System.out.println("main"+e);
        }
    }

}
